package com.lm.paymentweb;

import com.lm.paymentweb.dao.TestMapper;
import com.lm.paymentweb.remote.UserRemote;
import io.seata.spring.annotation.GlobalTransactional;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class TestService {

    @Resource
    private UserRemote userRemote;

    @Resource
    private TestMapper testMapper;

    @GlobalTransactional(rollbackFor = Exception.class)
    public void test() throws Exception {
        testMapper.testSeata();

        userRemote.testSeata();

        throw new Exception();
    }
}
